﻿;
(function (window, angular) {
    'use strict';

    // 当前环境
    var env = 'online';

    // 兼容处理
    var hostOrigin
    if (!window.location.origin) {
        hostOrigin = window.location.protocol + '//' + window.location.host;
    } else {
        hostOrigin = window.location.origin;
    }

    window.AppData = {};
    // 不同环境下的跳转产品基础路径
    var partsBaseUrlMap = {
        "dev": "https://dev.parts.hanyunapp.cn",
        "test": "https://test.parts.hanyunapp.cn",
        "pre": "http://t.parts.hanyunapp.cn",
        "online":"https://parts.hanyunapp.cn",
    };
    // 不同环境下 session的名称
    var partsSessionIdMap = {
        "dev": 'BJ_SESSION',
        "test": 'BJ_SESSION',
        "pre": 'SESSION',
        "online": 'SESSION',
    };
    // 不同环境下 系统生成的二维码里配置的地址
    var traceUrlMap = {
        "test": "https://pms.hanyunapp.cn",
        "online": "http://xgbj.xcmg.com:19000"
    };
    // 图片或文件地址（华为云）
    var ossUrlMap = {
        test: "https://obstest10.obs.cn-southwest-2.myhuaweicloud.com/",
        online: "https://zhhfw.obs.cn-southwest-2.myhuaweicloud.com/",
    };
    window.AppData.config = {
        "baseUrl": {
            "Site": hostOrigin + "/",
            "UploadSite": hostOrigin + "/zuul/",
            "LoginSite": hostOrigin + "/index.html?",
            "TargetBaseSite": hostOrigin + "/main.html#",

            "Image": hostOrigin + "/dev/image/read/",
            // "TracePage": traceUrlMap[env] + "/#/antiFake?barcode=",
            "TracePage": "",
            "BarcodeBoxPage": traceUrlMap[env] + "/#/barcodeBox?boxupId=",
            "PotentialSupplierPage": traceUrlMap[env] + "/#/potentialSupply",

            "PartsBaseUrl": partsBaseUrlMap[env],
            "PartsSessionId": partsSessionIdMap[env],
            "BjxlshFtp": partsBaseUrlMap[env] + '/file/',
            "ImgOssUrl": ossUrlMap[env],
            "ImgMinioUrl": hostOrigin,
            // 可以跳转到产品的菜单路由state
            "PartsStates": [
                "app.sales.parts.customerTag", // 客户标签
                "app.sales.parts.customerList", // 客户列表
                "app.sales.parts.equityGrade", // 等级管理
                "app.sales.parts.salesOrder.cashIntro", // 收银
                "app.sales.parts.salesOrderOut.cashIntro", // 收银
            ]
        },
        "serviceName": {
            "auth": 'ius',
            "dReport": 'dev-report',
            "device": 'dev',
            "sync": "sync",
            "mt": "mt",
        },
        "otherData": {
            "sysName": "广汽仓储平台",
            "sysSite": 1
        }
    };
})(window, window.angular);
